package com.xuyang.server;

import java.io.IOException;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import com.xuyang.utils.MySqlHelper;

/**
 * Servlet implementation class ResetPwServlet
 */
public class ResetPwServlet extends HttpServlet {
	private static final long serialVersionUID = 1L;
	protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
		request.setCharacterEncoding("UTF-8");
		response.setCharacterEncoding("UTF-8");
		response.setHeader("Content-Type", "charset=utf-8");
		String uname=request.getParameter("uname");
		System.out.println(uname);
		boolean bo=MySqlHelper.getInstance().update("update users set password=111111 where username=?", new Object[]{uname});
		if(bo){
			response.getWriter().write("ok");
		}else {
			response.getWriter().write("error");
		}
		
	}


}
